home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / ifo_subpic.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  1.5 KB  |  65 lines

  1.  
  2. /*
  3.  * SUBPICTURE TABLE
  4.  *
  5.  * Copyright (C) 1998,1999  Thomas Mirlacher
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 2 of the License, or
  10.  * (at your option) any later version.
  11.  * 
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  * 
  21.  * The author may be reached as dent@cosy.sbg.ac.at, or
  22.  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
  23.  * Austria
  24.  *
  25.  *------------------------------------------------------------
  26.  *
  27.  */
  28.  
  29.  
  30. #ifdef PARSER
  31. #include <stdio.h>
  32. #endif
  33. #include <stdlib.h>
  34. #include <sys/types.h>
  35. //#include <unistd.h>
  36. #include "ifo.h"
  37.  
  38. #include "misc.h"
  39. #include "decode.h"
  40.  
  41.  
  42. typedef struct {
  43.     u_int   zero    : 32;        // 0x00000000 ?
  44.     u_char  zero1    : 8;        // 0x00 ?
  45.     u_char  num    : 8;        // number of SPUs
  46. } spu_hdr_t;
  47.  
  48. #define SPU_HDR_LEN    6
  49.  
  50. /**
  51.  * Sub Picture Unit
  52.  */
  53.  
  54. int ifoGetSPU (char *_hdr, char **ptr)
  55. {
  56.     spu_hdr_t *hdr = (spu_hdr_t *) _hdr;
  57.  
  58.     if (!_hdr)
  59.         return -1;
  60.  
  61.     *ptr = _hdr + SPU_HDR_LEN;
  62.     
  63.     return hdr->num;
  64. }    
  65.